package timing.ukulele.storage.dictionary;

public enum FileTypeEnum {
    folder,
    excel,
    word,
    ppt,
    pdf,
    image,
    gif,
    video,
    sound,
    text,
    zip,
    unknown;

    public static String getFileType(String extName){
        if(folder.equals(extName)){
            return folder.name();
        }
        if("xls".equalsIgnoreCase(extName)||"xlsx".equalsIgnoreCase(extName)){
            return excel.name();
        }
        if("doc".equalsIgnoreCase(extName)||"docx".equalsIgnoreCase(extName)){
            return word.name();
        }
        if("ppt".equalsIgnoreCase(extName)||"pptx".equalsIgnoreCase(extName)){
            return ppt.name();
        }
        if(pdf.name().equalsIgnoreCase(extName)){
            return pdf.name();
        }
        if("png".equalsIgnoreCase(extName)||"jpg".equalsIgnoreCase(extName)
                ||"jpeg".equalsIgnoreCase(extName)||"bmp".equalsIgnoreCase(extName)){
            return image.name();
        }
        if(gif.name().equalsIgnoreCase(extName)){
            return gif.name();
        }
        if("avi".equalsIgnoreCase(extName)||"mp4".equalsIgnoreCase(extName)){
            return video.name();
        }
        if("mp3".equalsIgnoreCase(extName)){
            return sound.name();
        }
        if("txt".equalsIgnoreCase(extName)){
            return text.name();
        }
        if("zip".equalsIgnoreCase(extName)||"rar".equalsIgnoreCase(extName)){
            return zip.name();
        }
        return unknown.name();
    }
}
